#ifndef __LED_LIST_EXT_H__
#define __LED_LIST_EXT_H__

#include <stdbool.h>
#include "list_base.h"
// app
#include "common_param.h"

#define MID_HEAP_MALLOC(ulSize)            LIST_HEAP_MALLOC(ulSize)
#define MID_HEAP_FREE(p)                   LIST_HEAP_FREE(p)

#define LIST_TRAVERSE(_pList, _pData)  for (list_node_t *p = &(_pList)->ptHead; (p->ptNext != &(_pList)->ptHead ? ((_pData) = p->ptNext->pData, 1) : 0); p = p->ptNext)

#define LED_NAME_MAX_LEN 127

void create_node_data(uint32_t uNodeId);
void delete_node_data(uint32_t uNodeId);
void update_node_data(uint32_t uNodeId, node_parm_t tNodeData);
void delete_all_node_data(void);
node_parm_t *select_node_data(uint32_t uNodeId);
bool update_all_node_cycle_cnt(void);

void create_monitor_data(uint32_t uNodeId, uint32_t uMonitorId);
void delete_monitor_data(uint32_t uNodeId, uint32_t uMonitorId);
void update_monitor_data(uint32_t uNodeId, uint32_t uMonitorId, mntr_parm_t tMonitorData);
void delete_all_monitor_data_by_node_p(node_parm_t *ptNodeData);
void delete_all_monitor_data_by_node_id(uint32_t uNodeId);
mntr_parm_t *select_monitor_data(uint32_t uNodeId, uint32_t uMonitorId);

int32_t set_led_parm(uint32_t uLedId, char *ptsLedName, uint32_t LedNameLen);
uint32_t get_led_node_sum(void);
uint32_t get_led_monitor_sum(uint32_t uNodeId);
uint32_t get_led_node_id_by_num(uint32_t uNodeIndex);
uint32_t get_led_monitor_id_by_num(uint32_t uNodeId, uint32_t uMonitorIndex);

#endif // __LED_LIST_EXT_H__
